package com.hlz.rabbit.mq.qos;

import com.hlz.rabbit.mq.util.RabbitMqUtils;
import com.rabbitmq.client.Channel;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

/**
 * @author Hongliang Zhu
 * @create 2022-11-28 22:39
 */
public class QosProducer {

    public static void main(String[] args) throws IOException, TimeoutException {
        Channel channel = RabbitMqUtils.getChannel();
        channel.queueDeclare("qos_queue", false, false, false, null);


        for (int i = 0; i < 20; i++) {
            channel.basicPublish("", "qos_queue", null, ("message" + i).getBytes());
        }
        channel.close();
    }
}
